import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop0012_商品管理-搜索商品"
# 1. 打开后台网站
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
# 2.搜索商品
DBshopEnterMenu2(firefox,"商品管理","管理商品")
firefox.find_element_by_name("goods_name").send_keys("美的")
firefox.find_element_by_xpath("/html/body/div[2]/div/div[2]/table/tbody/tr[1]/td[9]/p/button").click()
# 断言
if firefox.find_element_by_xpath("/html/body/div[2]/div/div[2]/table/tbody/tr[2]/td[3]"):
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()
